import { get, post } from "@/api/request";

// 登录
export const apiLogin = p => post("/user/login", p);
// 注册
export const apiRegister = p => post("/user/register", p);
// 发送验证码
export const apiSendCode = p => post("/user/email", p);
// 查询所有分类数据
export const apiCategoryList = p => get("/category/list", p);
// 分页查询商品列表
export const apiProductPage = p => get("/product/page", p);
// 商品详情
export const apiProductDetail = p => get(`/product/detail/${p.id}`);
// 用户详情
export const apiUserDetail = id => get(`/user/detail/${id}`);
// 获取商品图片集
export const apiProductImages = p => get(`images/list/`, p);
// 新增商品
export const apiProductAdd = p => post("/product/add", p);
// 通过ID查询用户
export const apiGetUserById = p => get(`/user/getById?id=${p}`, );
// 文件删除
export const apiFileRemove = p => post(`/file/remove?filename=${p}`);
//  订单接口
export const apiCreateOrder = p => post("/order/create", p);
export const apiGetBuyerList = p => get("/order/buyer/list", p);
export const apiGetSellerList = p => get("/order/seller/list", p);
export const apiUpdateOrderStatus = p => post("/order/status/update", p);
// 获取消息通过用户ID
export const apiGetMessageBy2Id = p => get("/message/list2Id", p);
// 提交评论
export const apiSendComment = p => post("comment/add", p);
